#include <iostream>
#include <algorithm>
using namespace std;

const int N  = 2e6 + 10;

int n, m;
int a[N];

int main()
{
	cin >> n >> m;
	for (int i = 1; i <= m; i++)	cin >> a[i]; 
	
	sort(a + 1, a + 1 + m);
	
	for (int i = 1; i <= m; i++)
	{
		cout << a[i] << " ";
	}
	cout << endl;
	
	return 0;
}
